from typing import List


# 1103. 分糖果 II
def distributeCandies(candies: int, num_people: int) -> List[int]:
    re = [0] * num_people

    start = 1
    while candies > 0:
        re[(start - 1) % num_people] += start if candies > start else candies
        candies -= start
        start += 1
    return re


candies_1 = 7
num_people_1 = 4
result = distributeCandies(candies_1, num_people_1)
print(f'result {result}')

candies_1 = 10
num_people_1 = 3
result = distributeCandies(candies_1, num_people_1)
print(f'result {result}')
